<form method="POST" action="index.php?app=ectools&ctl=regions&act=saveDlArea" target="{update:'messagebox'}" class="tableform" id="area_edit_form">
<div class="division">
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <th><{t}>地区名称：<{/t}><input type="hidden" name="region_id" value="<{$area.region_id}>"></th>
      <td><input type="text" vtype="required" name="local_name" maxlength="20" value="<{$area.local_name}>"></td>
    </tr>
    <tr>
        <th><{t}>上级地区：<{/t}></th>
        <td>
        <input type='text' id="superior_region_name" readonly="true" onclick='regionSelect(this);' class="lnk" value='<{if $area.parent_name==""}><{t}>[无上级]<{/t}><{else}><{$area.parent_name}><{/if}>'/><span class="notice-inline"><{t}>点击输入框可以更换地区的上级节点<{/t}></span>
        <input type='hidden' id="superior_region_id" name='p_region_id' value='<{$area.p_region_id}>'/>
        </td>
    </tr>
    <tr>
        <th><{t}>排序：<{/t}></th>
        <td><input type="number" name="ordernum" vtype="digits" size="2" class="_x_ipt" value="<{$area.ordernum|default:0}>"><span class="notice-inline"><{t}>数字越小越靠前<{/t}></span></td>
    </tr
    ></table>
  </div>

<div class="table-action">
	<{button label=$___ectools="保存"|t:'ectools' type="submit" }> <input type="hidden" name="package" value="mainland">
	<{button label=$___ectools="取消"|t:'ectools' isCloseDialogBtn="true"}>
</div>


</form>
<script>
function regionSelect(el){
    var el=$(el);
    var explorer = window.navigator.userAgent ;
    if(explorer.indexOf("Chrome") >= 0){
 	   window.open('index.php?app=ectools&ctl=regions&act=showRegionTreeList&p[0]='+el.uid+'&p[1]=&p[2]='+el.id+'&p[3]='+el.getParent().getElement('input[type=hidden]').id,"地区选择", "width=270, height=" + window.getSize().y*.9 + ",top=0,left=0,toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no,alwaysRaised=yes,depended=yes");
    }else{
  	  Ex_Loader('modedialog',function(){
  			 new ModeDialog('index.php?app=ectools&ctl=regions&act=showRegionTreeList&p[0]='+el.uid,{
  				  width:250,height:340,params:{iptText:el,iptHidden:el.getParent().getElement('input[type=hidden]')}});
  		  });
    }
 }

	$('area_edit_form').store('target',{
		onComplete:function(){
			if($('area_edit_form').getParent('.dialog'))
			$('area_edit_form').getParent('.dialog').retrieve('instance').close();
		}
	});


</script>